package com.gomtel.smartdevice.activity;

import com.gomtel.smartdevice.R;
import com.gomtel.smartdevice.global.WatchApplication;
import com.gomtel.smartdevice.ui.dialog.ProgressDialog;
import com.gomtel.smartdevice.ui.dialog.ShowDialog;

/**
 * Created by Administrator on 2018/5/6.
 */

public class MainActivity extends BaseActivity {

    private ShowDialog showDialog;
    private ProgressDialog progressDialog;

    @Override
    protected void onCreate() {
        setContentView(R.layout.activity_main);

        showDialog = ShowDialog.newInstance();
        progressDialog = showDialog.showProgressStatus(this, "发生错误，正在关闭应用 ...");
        progressDialog.show();
        WatchApplication.executorService.submit(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1500);
                    progressDialog.dismiss();
                    WatchApplication.exitApp();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
    }
}
